﻿
@{
    ViewData["Title"] = "用户注册";
    Layout = "~/Areas/WX/Views/Shared/_Layout.cshtml";
}

@section Tops{
    <style>
        .backg {
            background: #F4F5F6;
        }

        .remindont {
            color: red;
            margin-left: 24%;
        }

        .select {
            width: 230px;
            background: white;
        }
    </style>
}

<header class="hui-header">
    <div id="hui-back" onclick="gotoHome()"></div>
    <h1>用户注册</h1>
</header>

<form class="hui-wrap" id="form1" method="post">
    <div class="hui-center-title" style="margin-top: 35px;"><h1 style="border:0px;">福利楼便民系统</h1></div>

    <div style="margin:20px 10px; margin-bottom:15px;" class="hui-form" id="form1">
        <div class="hui-form-items">
            <div class="hui-form-items-title">登录名</div>
            <input type="number" class="hui-input hui-input-clear" placeholder="短号或长号" name="username" id="username" />

        </div>

        <div class="hui-form-items">
            <div class="hui-form-items-title">姓名</div>
            <input type="text" class="hui-input hui-input-clear" placeholder="请输姓名" name="name" id="name" />

        </div>

        <div class="hui-form-items">
            <div class="hui-form-items-title">登录密码</div>
            <input type="password" class="hui-input hui-pwd-eye" placeholder="登录密码" name="pwd" id="pwd" />

        </div>



        <div class="hui-form-items">
            <div class="hui-form-items-title">确认密码</div>
            <input type="password" class="hui-input hui-pwd-eye" placeholder="确认密码" name="pwdc" id="pwdc" />

        </div>



    </div>



    <div style="padding:10px; padding-top:10px;">
        <button type="button" class="hui-button hui-button-large hui-primary" id="submitBtn">立即注册</button>
    </div>
</form>

@section Scripts{
    <script src="~/HUI-master/js/hui-form.js"></script>

    <script type="text/javascript">
        hui.formInit();
        //表单元素数据收集演示
        hui('#submitBtn').click(function () {
            var data = hui.getFormData('#form1');
            hui.post(
                '/WX/Account/Registered',
                data,
                function (msg) {
                    console.log(msg)
                    if (msg == 'ok') {
                        hui.alert('注册成功', '去登录', function () {
                            window.location.href = '/WX/Account/Login'
                        }) 
                      
                    } else {                      
                        hui.alert(msg, '修改') 
                    }
                },
                function (e) {
                    hui.iconToast('读取消息失败', 'warn');
                }
            );
        });
    </script>

}

